﻿using System.Collections.Generic;
using System.Linq;
using MyFloridaHouse.DataAccess;
using MyFloridaHouse.libSvDTO;

namespace MyFloridaHouse.libServiceBusinessRules
{
    public static class DistrictData
    {
        public static List<RegionDataDTO> GetDistrictData(int iDistrictID, string iRegionIDList, string iSourceLayerIDList, string iDictionaryIDList)
        {
            DAL_CensusData dal = new DAL_CensusData();
            var queryResults2 = dal.GetDistrictDataSummary(iDistrictID, iRegionIDList, iSourceLayerIDList, iDictionaryIDList);
			var x = (from q in queryResults2 select q).ToList();	//executes immediately (not lazy loading)
			return x.Count == 0 ? new List<RegionDataDTO>() : x;
        }
    }
}
